<template>
    <div>
        <van-nav-bar 
        title="地址管理" 
        @click-left="onClickLeft"
       
        >
            <van-icon name="arrow-left" slot="left" color='black' size='20px'/>
        </van-nav-bar>

        <van-row type="flex" justify="space-between"  class='van'>
            <van-col span="8" offset="1">姓名：{{name}}</van-col>
            <van-col span="11" >手机号：{{tel}}</van-col>
        </van-row>

        <van-row type="flex" justify="space-between" >
            <van-col span="24" offset="1">地址：{{ads}}{{adp}}{{addetail}}</van-col>   
        </van-row>
        <div class='shadow'></div>

        <van-row>
            <van-col span="3" offset="1"><span><van-checkbox v-model="checked"></van-checkbox></span></van-col>
            <van-col span="4" offset="10"><span class="sp4"><van-icon name="edit" slot="left" color='black' size='20px'/></span>编辑</span></van-col>
            <van-col span="4" offset="1"><span class="sp4"><van-icon name="delete" slot="left" color='black' size='20px'/></span>删除</span></van-col>
        </van-row>
        <div @click='tap'>
            <van-row type="flex" justify="center" class='van1'>
                <van-col span="6">添加新地址</van-col>
            </van-row>
        </div>
        
        
    </div>
   
</template>

<script>
  import axios from 'axios'
  import qs from 'Qs'

  export default {
    name:'Addres',
    data () {
        return {
            checked:'',
            name:'',
            tel:'',
            ads:'',
            adp:'',
            addetail:'',
        }
    },
    methods: {
        tap(){
            this.$router.push('/addaddres')
        },
        onClickLeft(){
            this.$router.go(-1)
        }
    },
    mounted () {
        let ad=localStorage.getItem('address')
        
        let add=JSON.parse(ad)
        // console.log(add)
        this.name=add.name
        this.tel=add.tel
        this.adp=add.county
        this.addetail=add.addressDetail
        var _this=this
        axios({
            method:'post',
            url:'http://10.8.158.3:8080/sportapp/findaddressAll.do',
            headers:{'Content-Type':'application/x-www-form-urlencoded'},
            data:qs.stringify({
                token:_this.$store.state.token,
                })
            }).then((res)=>{
                console.log(res)

                // _this.list=res.data.info
            })
    }
}
</script>

<style scoped>
.van{
    margin-top: 20px;
    margin-bottom: 20px;
}
.van1{
    margin-top: 20px;
   
}
.shadow{
    width: 375px;
    height: 1px;
    background:silver;
    margin-top:10px;
    margin-bottom:10px;
}
.ck{
    zoom:170%;
    -webkit-appearance: radio;
    background:white
}
</style>
